<?xml version="1.0" encoding="UTF-8"?>
<definitions id="definitions" 
  xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:camunda="http://camunda.org/schema/1.0/bpmn"
  targetNamespace="Examples"
  xmlns:tns="Examples">
  
  <process id="process" isExecutable="true">
  
    <startEvent id="theStart" />
    
    <sequenceFlow id="flow1" sourceRef="theStart" targetRef="exclusiveGateway" />
    
    <exclusiveGateway id="exclusiveGateway" />
     
     <sequenceFlow id="flow2" sourceRef="exclusiveGateway" targetRef="expressionEnd">
      <conditionExpression xsi:type="tFormalExpression">${expressionWasExecuted}</conditionExpression>
     </sequenceFlow>
     
     <sequenceFlow id="flow3" sourceRef="exclusiveGateway" targetRef="delegateExpressionEnd">
      <conditionExpression xsi:type="tFormalExpression">${delegateExpressionWasExecuted}</conditionExpression>
     </sequenceFlow>
     
     <sequenceFlow id="flow4" sourceRef="exclusiveGateway" targetRef="classEnd">
      <conditionExpression xsi:type="tFormalExpression">${wasExecuted}</conditionExpression>
     </sequenceFlow>
     
     <endEvent id="expressionEnd">
       <messageEventDefinition camunda:expression="#{endEventBean.getJavaDelegate().execute(execution)}" />
     </endEvent>

     <endEvent id="delegateExpressionEnd">
       <messageEventDefinition camunda:delegateExpression="#{endEventBean.getJavaDelegate()}" />
     </endEvent>
  
     <endEvent id="classEnd">
       <messageEventDefinition camunda:class="org.camunda.bpm.engine.test.bpmn.event.end.DummyServiceTask" />
     </endEvent>
    
  </process>

</definitions>